package de.gwtprime.client.event;

import com.google.gwt.event.shared.GwtEvent;

import de.gwtprime.client.event.handler.QuestionAddedEventHandler;
import de.gwtprime.shared.requestFactory.QuestionProxy;

public class QuestionAddedEvent extends GwtEvent<QuestionAddedEventHandler>{
	
	public static Type<QuestionAddedEventHandler> TYPE = new Type<QuestionAddedEventHandler>(); 
	
	private QuestionProxy question;
	
	public QuestionAddedEvent(QuestionProxy question) {
		this.setQuestion(question);
	}

	@Override
	protected void dispatch(QuestionAddedEventHandler handler) {
		handler.onQuestionAdded(this);
	}

	@Override
	public Type<QuestionAddedEventHandler> getAssociatedType() {
		return TYPE;
	}

	public QuestionProxy getQuestion() {
		return question;
	}

	public void setQuestion(QuestionProxy question) {
		this.question = question;
	}


}
